package com.strato.jdbc.datasource.v1_0_0;

import java.util.Map;

import javax.sql.DataSource;

import com.strato.base.osgi.v1_0_0.BundleUtil;
import com.strato.jdbc.datasource.v1_0_0.activator.Activator;


public interface DataSourceFactory {

	public static final String COMMON_DATASOURCE="commonDS";
	public static final String MERCHANT_DATASOURCE="merchantDS";
	public static final String SEQUENCE_DATASOURCE="sequenceDS";
	public static final String QUEUE_DATASOURCE="queueDS";

	public DataSource getDataSource(String name);

	public void setDataSource(String name,DataSource dataSource);

	public DataSource removeDataSource(String name);

	public void destroy();
	
	public static DataSourceFactory getInstance(){
		DataSourceFactory dsf = BundleUtil.getCachedService(Activator.getContext(), DataSourceFactory.class, null);
		return dsf;
	}

	Map<String, DataSource> getDatasources();
}
